Skip to content

restore prime inference browser login and fix cancel shortcut labels - #142

Merged
kevinjosethomas merged 2 commits into
mainfrom
eng-4057-login-flow
Jun 11, 2026
Merged

restore prime inference browser login and fix cancel shortcut labels#142
kevinjosethomas merged 2 commits into
mainfrom
eng-4057-login-flow

Conversation

@kevinjosethomas

@kevinjosethomas kevinjosethomas commented Jun 11, 2026

Copy link
Copy Markdown
Member
  • selecting prime inference in /login lost its browser sign-in flow when api key providers became key-entry only; this brings it back.
  • the login dialog now runs the browser challenge and a manual paste-an-api-key fallback side by side, so whichever completes first wins.
  • keybinding hints on macos no longer relabel ctrl as cmd, since terminals send the literal control key, so the cancel hint now shows the keys that actually work.

Note

Medium Risk
Touches credential storage and auth flow for Prime Inference with concurrent browser/manual paths; UI hint change is low risk but login regression could block provider setup.

Overview
Restores Prime Inference /login to a browser sign-in flow while keeping a manual API-key paste path in the same dialog. The interactive mode now races loginPrimeInference against manual input (with a separate abort controller so pasting a key stops browser polling without closing the dialog), validates pasted keys via checkPrimeInferenceAccess, and finishes through a shared completePrimeInferenceLogin helper—replacing the standalone showPrimeInferenceApiKeyLoginDialog path.

Login dialog refactors input waiting into waitForInput(), reused by showManualInput and showPrompt, so empty submissions can re-arm input for the fallback flow.

Keybinding hints on macOS now show Ctrl for control shortcuts (terminals send Control, not Cmd) while Alt still displays as Option. Tests cover hint formatting, cancel keys, and re-arming manual input.

Reviewed by Cursor Bugbot for commit a67a46f. Bugbot is set up for automated code reviews on this repo. Configure here.

Note

Restore Prime Inference browser login and fix Ctrl keybinding labels on macOS

  • Restores the combined browser-based + manual API key login flow for Prime Inference by routing provider selection to showPrimeInferenceLoginDialog instead of the removed showPrimeInferenceApiKeyLoginDialog.
  • Both login paths run concurrently; manual API key entry aborts the browser flow and is validated for Prime Inference access before completing login.
  • Extracts shared credential storage, team selection, and completion logic into a new completePrimeInferenceLogin helper.
  • Fixes macOS keybinding hints in keybinding-hints.ts to display Ctrl instead of Cmd for the Control modifier (terminals send a literal Control key, not Command).
  • Adds a waitForInput() method on LoginDialogComponent so callers can await re-submission of the existing input field without re-rendering it.

Macroscope summarized a67a46f.

@linear

linear Bot commented Jun 11, 2026

Copy link
Copy Markdown
ENG-4057 No Prime Inference flow for login

Seems like with our earlier fix where api key providers are only API keys and not login flows, Prime Inference now only has an API key flow (where you enter an API key). The old flow where it opens your browser and automatically generates a key seems to be missing when I select Prime Inference in /login providers. That flow was much easier and far more convenient.

Can you reintroduce that flow for Prime Inference, either by making an exception to the api key provider flow for Prime Inference, or considering Prime Inference a subscription rather than API key.

Another small bug in the API key flow, "esc" no longer exits the API key entering popup, only Ctrl+C does, so update the label to match that.

Review in Linear

Comment thread packages/coding-agent/src/modes/interactive/interactive-mode.ts

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Fix All in Cursor

❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.

Reviewed by Cursor Bugbot for commit a67a46f. Configure here.

// so an aborted browser flow can never surface as an unhandled rejection.
browserLogin.catch(() => {});

const result = await Promise.race([browserLogin, manualKeyEntry]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Manual key UI after challenge

Medium Severity

Manual API key entry is wired only inside the onAuth callback, so if loginPrimeInference fails before the browser challenge is created (for example challenge HTTP errors or malformed responses), Promise.race rejects and the dialog closes without ever showing the paste-key fallback that the removed API-key-only login dialog always offered.

Fix in Cursor Fix in Web

Reviewed by Cursor Bugbot for commit a67a46f. Configure here.

@kevinjosethomas
kevinjosethomas merged commit 63eedf1 into main Jun 11, 2026
3 checks passed
@kevinjosethomas
kevinjosethomas deleted the eng-4057-login-flow branch June 11, 2026 22:09
zhengr pushed a commit to zhengr/prime-agent that referenced this pull request Aug 8, 2026
…rimeIntellect-ai#142)

* restore prime inference browser login with manual key fallback

* keep aborted browser login rejection explicitly handled
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant